﻿@model GameSchoolApplication.Models.Person
@{
    ViewBag.Title = "Forsíða";
    ViewBag.WideContent = true;
	Layout = "~/Views/Shared/_StudentLayout.cshtml";
}


<section id="messages">
    <h2>Skilaboð frá kennara</h2>
	@if (Model.LatestAnnouncements.Count() > 0)
 {
     foreach (var item in Model.LatestAnnouncements)
     {
			<div class="announcement">
				<p id="TitleAnnounceFront">@item.Game.Title</p>
				<p>@item.Content</p>
			</div>

		 }
	 }
    @Html.ActionLink("Öll skilaboð", "StudentIndex", "Announcement")
</section>

<section id="activegames">
    @foreach (var level in Model.CurrentLevels)
    { 
        <div class="game">
        <h2>@level.Level.Game.Title:</h2>
        <h3>Óleyst verkefni</h3>
        @if (level.PendingAssignments.Count() > 0)
        { 
            <ul>
                @foreach (var assignment in level.PendingAssignments)
                {
                    <li>@Html.ActionLink(assignment.Title, "HandIn", "Assignment", new { assignmentId = assignment.AssignmentId }, new { })</li>
                }
            </ul>
        }
        else
        {
            <p>Engin óleyst verkefni</p>
        }
        <h3>Óleyst próf</h3>
        @if (level.PendingTests.Count() > 0)
        { 
            <ul>
                @foreach (var test in level.PendingTests)
                {
                    <li>@Html.ActionLink(test.TestName, "HandIn", "Test", new { testId = test.TestId }, new { })</li>
                }
            </ul>
        }
        else
        {
            <p>Engin óleyst próf</p>
        }
        </div>
    }
</section>





